package com.ctshk.rpc.order.custom.dto.tourist;

import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 签证列表dto
 */
@Data
@ApiModel(value="签证列表dto", description="签证列表dto")
public class CustomOrderTouristVisaListDTO implements Serializable {
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "所属订单")
    private Long orderId;

    @ApiModelProperty(value = "游客类型主数据ID")
    private Long mainDataId;

    @ApiModelProperty(value = "游客类型名称")
    private String touristTypeName;

    @ApiModelProperty(value = "游客ID")
    private Long touristId;

    @ApiModelProperty(value = "中文姓")
    private String cnSurname;

    @ApiModelProperty(value = "中文姓名")
    private String cnName;

    @ApiModelProperty(value = "签证费用")
    private BigDecimal visaAmount;

    @ApiModelProperty(value = "证件收集状态（1：未收齐，2：已收齐，3：未收齐）")
    private Integer collectionStatus;

    @ApiModelProperty(value = "是否需补齐资料（0：否，1：是）")
    private Integer needSupplyInfo;

    @ApiModelProperty(value = "提交运单号")
    private String submitTrackingNumber;

    @ApiModelProperty(value = "提交人")
    private Long submitUserId;

    @ApiModelProperty(value = "提交人名称")
    private String submitUserName;

    @ApiModelProperty(value = "提交人部门")
    private String submitUserDept;

    @ApiModelProperty(value = "提交时间")
    private LocalDateTime submitTime;

    @ApiModelProperty(value = "补齐人")
    private Long makeUpUserId;

    @ApiModelProperty(value = "补齐人名称")
    private String makeUpUserName;

    @ApiModelProperty(value = "补齐人部门")
    private String makeUpUserDept;

    @ApiModelProperty(value = "补齐时间")
    private LocalDateTime makeUpTime;

    @ApiModelProperty(value = "补齐运单号")
    private String makeUpTrackingNumber;

    @ApiModelProperty(value = "出签状态（1：出签成功，2：出签失败，3：待送签，4：待出签）")
    private Integer signOutStatus;

    @ApiModelProperty(value = "出签运单号")
    private String signOutTrackingNumber;

    @ApiModelProperty(value = "出签时间")
    private LocalDateTime signOutTime;

    @ApiModelProperty(value = "送签时间")
    private LocalDateTime sendTime;

    @ApiModelProperty(value = "缺失资料名称")
    private String missingCertificate;

    @ApiModelProperty(value = "建议提交时间")
    private LocalDateTime adviseSubmitTime;

    @ApiModelProperty(value = "第一步备注")
    private String step1Remark;

    @ApiModelProperty(value = "第二步备注")
    private String step2Remark;

    @ApiModelProperty(value = "出签快递时间")
    private LocalDateTime signOutExpressTime;

    @ApiModelProperty(value = "出签回执文件")
    private String signOutReceiptFile;

    @ApiModelProperty(value = "出签签证文件JSON")
    private List<String> signOutFilesJson;

    public void setSignOutFilesJson(String signOutFilesJson) {
        this.signOutFilesJson =  new ArrayList<>();
        if(StringUtils.isNotBlank(signOutFilesJson)) {
            List<String> strings = JSON.parseArray(signOutFilesJson, String.class);
            this.signOutFilesJson.addAll(strings);
        }
    }
}
